There are two primary mechanisms that broaden spectral emission
(or absorption) lines: Doppler broadening and collision-induced
broadening.
Doppler broadening occurs because of the relative thermal
motions of the molecules in a gas. Simply put, the molecules are
all bouncing off each other, so some are moving towards you and
some away, some fast and some slow. Each molecule's spectrum is
Doppler shifted by it's current velocity. The composite spectrum
from all the individual molecules has its lines smeared out or
broadened as a result. As you can guess, the amount of broadening
depends on the temperature of the gas.
Collision-induced broadining, sometimes called pressure
broadening, is is a result of the deformation of the molecules when
they bounce off each other. For example, they may not be as
symmetrical after a collision as they were before. These
deformations perturb the quantum mechanical energy levels of the
molecule, slightly shifting the frequencies of the emission or
absorption lines. Just like Doppler broadening, the composite
spectrum's lines are therefore broadened. This effect depends on
both the pressure and temperature of the gas.
See spectralcalc for complete details and online
simulations.
Starlight can be reddened by the Doppler Effect and by the
gravity well (that light from a star finds itself in).